﻿/*======================================
作者：洞庭夕照
创建：2017.9.27
网站：www.ninesky.cn
      mzwhj.cnblogs.com
支持：bbs.ninesky.cn
代码：git.oschina.net/ninesky/Ninesky
版本：v1.0.0.0
======================================*/
using System;
using System.Collections.Generic;
using System.Text;
using Ninesky.Models;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
using Ninesky.DBLibrary;

namespace Ninesky.Service
{
    /// <summary>
    /// 文章服务
    /// </summary>
    public class ArticleService: BaseService<Article>
    {
        public ArticleService(NsDbContext nsDbContext) :base(nsDbContext)
        {
            
        }

        /// <summary>
        /// 根据内容Id 查找文章
        /// </summary>
        /// <param name="id">内容Id</param>
        /// <returns></returns>
        public async Task<Article> FindByContentId(int id)
        {
            return await FindAsync(a => a.ContentId == id);
        }
    }
}
